/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ci.web.action;

import com.ci.model.impl.HDSerial;
import com.ci.service.port.HDSerialLocal;
import com.ci.web.view.HDColumnModel;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.inject.Named;

/**
 *
 * @author Administrator
 */
@Named("HDSerialAction")
@ManagedBean(name = "HDSerialAction")
@RequestScoped
public class HDSerialAction implements Serializable {

    @EJB
    HDSerialLocal serialService;
    private List<HDSerial> dataList;

    private List<HDColumnModel> columns;

    private void createDynamicColumns(){
        columns = new ArrayList<HDColumnModel>();
    }

    public List<HDSerial> getDataList() {
        if (dataList == null) {
            dataList = serialService.getAll();
        }
        return dataList;
    }
    private HDSerial selectedItem;

    /**
     * @return the selectedItem
     */
    public HDSerial getSelectedItem() {
        return selectedItem;
    }

    /**
     * @param selectedItem the selectedItem to set
     */
    public void setSelectedItem(HDSerial selectedItem) {
        this.selectedItem = selectedItem;
    }

    /**
     * @return the columns
     */
    public List<HDColumnModel> getColumns() {
        return columns;
    }

    /**
     * @param columns the columns to set
     */
    public void setColumns(List<HDColumnModel> columns) {
        this.columns = columns;
    }

}
